<p>
  <b>Title:</b>
  <%=h @movie.title %>
</p>

<p>
  <b>Description:</b>
  <%=h @movie.description %>
</p>

<p>
  <b>Rating:</b>
  <%=h @movie.rating %>
</p>

<p>
  <b>Released on:</b>
  <%=h @movie.released_on %>
</p>

<table>
  <tr>
    <th>User</th>
    <th>Score</th>
    <th>Date</th>
  </tr>

<% @movie.reviews.each do |review| %>
  <tr>
    <td><%=h review.user.login %></td>
    <td><%=h review.score %></td>
    <td><%=h review.updated_at %></td>

<td><%= link_to 'Show', [@movie,review] %></td>
  <% if review.user == current_user %>
    <td><%= link_to 'Edit', edit_movie_review_path(@movie,review) %></td>
    <td><%= link_to 'Destroy', [@movie,review], :confirm => 'Are you sure?', :method => :delete %></td>
  <% end %>

  </tr>
<% end %>
</table>

<p>
<%= link_to 'New review', new_movie_review_path(@movie) %>
</p>


<%= link_to 'Edit', edit_movie_path(@movie) %> |
<%= link_to 'Back', movies_path %>